﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RssNewsFeeder.Model.Business
{
    public class NewsCompanyCollection:IDisposable
    {
        private Data.DataAccessLayer _dal;
        private List<object> _newsCompanies;

        public NewsCompanyCollection()
        {
            _dal = Data.DataAccessLayer.CreateInstance();
            _newsCompanies = new List<object>();
        }

        public List<object> NewsCompanies
        {
            get
            {
                GetNewsCompanyCollection();
                return _newsCompanies;
            }
        }
        private void GetNewsCompanyCollection()
        {
           _newsCompanies= _dal.GetNewsCompanyCollection();
        }

        #region IDisposable Members

        void IDisposable.Dispose()
        {
            _newsCompanies.Clear();
        }

        #endregion
    }
}
